#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

//int main()
//{
//	cout << "hello world!" << endl;
//	return 0;
//}

class Stack
{
public:
	/*Stack()
	{
		int* tmp = (int*)malloc(sizeof(int) * 5);
		if (tmp == NULL)
		{
			perror("malloc fail");
		}
		_arr = tmp;
		_capacity = 5;
		_top = -1;
	}*/
	Stack(int capacity = 4)
	{
		int* tmp = (int*)malloc(sizeof(int) * capacity);
		if (tmp == NULL)
		{
			perror("malloc fail");
		}
		_arr = tmp;
		_capacity = capacity;
		_top = -1;
	}
	
private:
	int* _arr;
	int _capacity;
	int _top;
};

int main()
{
	Stack s1;
	Stack s2(3);
	return 0;
}